package spring.AOPDemo.BeforeAdviceTest;


import org.springframework.aop.MethodBeforeAdvice;

import java.lang.reflect.Method;
/*
强制使用礼貌用语增强
 */
public class GreetingBeforeAdvice implements MethodBeforeAdvice{
    /*
    method是目标类的方法；objects是目标类方法的入参；而o为目标类实例
     */
    public void before(Method method, Object[] objects, Object o) throws Throwable {
        String client  = (String)objects[0];
        System.out.println("欢迎光临 " + client + " 先生");
    }
}
